package com.erms.bean;

/**
 * StudentTeachId entity. @author MyEclipse Persistence Tools
 */

public class StudentTeachId implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long	serialVersionUID	= 245274626543950382L;
	private User	user;
	private Teach	teach;

	// Constructors

	/** default constructor */
	public StudentTeachId() {

	}

	/** full constructor */
	public StudentTeachId(User user, Teach teach) {

		this.user = user;
		this.teach = teach;
	}

	// Property accessors

	public User getUser() {

		return this.user;
	}

	public void setUser(User user) {

		this.user = user;
	}

	public Teach getTeach() {

		return this.teach;
	}

	public void setTeach(Teach teach) {

		this.teach = teach;
	}

	public boolean equals(Object other) {

		if ((this == other)) return true;
		if ((other == null)) return false;
		if (!(other instanceof StudentTeachId)) return false;
		StudentTeachId castOther = (StudentTeachId) other;

		return ((this.getUser() == castOther.getUser()) || (this.getUser() != null
				&& castOther.getUser() != null && this.getUser().equals(
				castOther.getUser())))
				&& ((this.getTeach() == castOther.getTeach()) || (this
						.getTeach() != null && castOther.getTeach() != null && this
						.getTeach().equals(castOther.getTeach())));
	}

	public int hashCode() {

		int result = 17;

		result = 37 * result
				+ (getUser() == null ? 0 : this.getUser().hashCode());
		result = 37 * result
				+ (getTeach() == null ? 0 : this.getTeach().hashCode());
		return result;
	}

}
